<?php

class Autor_message_to {
	
	private $number;
	private $from_autor_login;
	private $to_autor_login;
	private $title;
	private $content;
	private $date;
	private $state;
	
	public function __construct($number, $from_autor_login, 
									$to_autor_login, $title,
									$content, $date, $state) {
		$this->number = $number;
		$this->from_autor_login = $from_autor_login;
		$this->to_autor_login = $to_autor_login;
		$this->title = $title;
		$this->content = $content;
		$this->date = $date;
		$this->state = $state;
	}
	
	public function get_number() {
		return $this->number;
	}
	
	public function get_from_autor_login() {
		return $this->from_autor_login;
	}
	
	public function get_to_autor_login() {
		return $this->to_autor_login;
	}
	
	public function get_title() {
		return $this->title;
	}
	
	public function get_content() {
		return $this->content;
	}
	
	public function get_date() {
		return $this->date;
	}
	
	public function get_state() {
		return $this->state;
	}
	
	public function set_state($state) {
		$this->state = $state;
	}
	
	public function equals($object) {
		if ((get_class($this) != get_class($object)) ||
				($object == null))				
			 return false;
		else {
			if (($this->number == $object->get_number()) &&
				($this->from_autor_login = $object->get_from_autor_login()) &&
				($this->to_autor_login = $object->get_to_autor_login()) &&
				($this->title = $object->get_title()) &&
				($this->content = $object->get_content()) &&
				($this->date = $object->get_date()) &&
				($this->state = $object->get_state()))
				return true;
			return false;
		}
	}
	
	public function to_string() {
		return 'number: ' . $this->number . ' | ' . 
				'from autor login: ' . $this->from_autor_login . ' | ' .
				'to autor login: ' . $this->to_autor_login . ' | ' .
				'title: ' . $this->title . ' | ' .
				'content: ' . $this->content . ' | ' .
				'date: ' . $this->date . ' | ' .
				'state: ' . $this->state;				
	}
}

?>